package org.example.prop;


import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.convert.DataSizeUnit;
import org.springframework.stereotype.Component;
import org.springframework.util.unit.DataSize;
import org.springframework.util.unit.DataUnit;


@Component
@ConfigurationProperties(
        prefix = "aliyun.oss"
)
public class OssProperties {
    public static final String OSS_PREFIX = "aliyun.oss";
    private String endpoint;
    private String accessKeyId;
    private String accessKeySecret;
    private String bucketName;
    private long policyExpire;
    @DataSizeUnit(DataUnit.MEGABYTES)
    private DataSize maxSize;
    private String dirPrefix;
    private String bucketURL;


    public String getEndpoint() {
        return endpoint;
    }

    public void setEndpoint(String endpoint) {
        this.endpoint = endpoint;
    }

    public String getAccessKeyId() {
        return accessKeyId;
    }

    public void setAccessKeyId(String accessKeyId) {
        this.accessKeyId = accessKeyId;
    }

    public String getAccessKeySecret() {
        return accessKeySecret;
    }

    public void setAccessKeySecret(String accessKeySecret) {
        this.accessKeySecret = accessKeySecret;
    }

    public String getBucketName() {
        return bucketName;
    }

    public void setBucketName(String bucketName) {
        this.bucketName = bucketName;
    }

    public long getPolicyExpire() {
        return policyExpire;
    }

    public void setPolicyExpire(long policyExpire) {
        this.policyExpire = policyExpire;
    }

    public DataSize getMaxSize() {
        return maxSize;
    }

    public void setMaxSize(DataSize maxSize) {
        this.maxSize = maxSize;
    }

    public String getDirPrefix() {
        return dirPrefix;
    }

    public void setDirPrefix(String dirPrefix) {
        this.dirPrefix = dirPrefix;
    }

    public String getBucketURL() {
        return bucketURL;
    }

    public void setBucketURL(String bucketURL) {
        this.bucketURL = bucketURL;
    }

    public OssProperties() {
    }

}
